import type { GlobalTheme } from "naive-ui";
import { defineStore } from "pinia";

const styleStore = defineStore("style", {
  state: () => {
    return {
      collapsed: false,
      inverted: false,
      theme: <GlobalTheme | null>null,
      customTheme: <GlobalTheme>{
        name: "custom",
        common: {
          name: "common",
          // 字体
          fontFamily:
            'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
          fontFamilyMono:
            "v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",
          // 字体粗细
          fontWeight: "400",
          // 设置字体加粗
          fontWeightStrong: "500",
          // 贝塞尔曲线
          // 定义缓动函数，cubicBezierEaseInOut表示先加速后减速，cubicBezierEaseOut表示先加速后减速，cubicBezierEaseIn表示先加速后减速
          cubicBezierEaseInOut: "cubic-bezier(.4, 0, .2, 1)",
          cubicBezierEaseOut: "cubic-bezier(0, 0, .2, 1)",
          cubicBezierEaseIn: "cubic-bezier(.4, 0, 1, 1)",
          // 边框圆角
          borderRadius: "3px",
          borderRadiusSmall: "2px",
          // 字体大小
          fontSize: "14px",
          fontSizeMini: "12px",
          fontSizeTiny: "12px",
          fontSizeSmall: "14px",
          fontSizeMedium: "14px",
          fontSizeLarge: "15px",
          fontSizeHuge: "16px",
          // 行高
          lineHeight: "1.6",
          // 定义不同高度的变量
          heightMini: "16px", // 最小高度
          heightTiny: "22px", // 微小高度
          heightSmall: "28px", // 小高度
          heightMedium: "34px", // 中等高度
          heightLarge: "40px", // 大高度
          heightHuge: "46px", // 超大高度
          // 基础颜色
          baseColor: "#000",
          // 主颜色
          primaryColor: "#63e2b7",
          // 主颜色悬停
          primaryColorHover: "#7fe7c4",
          // 主颜色按下
          primaryColorPressed: "#5acea7",
          // 主颜色补充
          primaryColorSuppl: "rgb(42, 148, 125)",
          // 信息颜色
          infoColor: "#70c0e8",
          // 信息颜色悬停
          infoColorHover: "#8acbec",
          // 信息颜色按下
          infoColorPressed: "#66afd3",
          // 信息颜色补充
          infoColorSuppl: "rgb(56, 137, 197)",
          // 成功颜色
          successColor: "#63e2b7",
          // 成功颜色悬停
          successColorHover: "#7fe7c4",
          // 成功颜色按下
          successColorPressed: "#5acea7",
          // 成功颜色补充
          successColorSuppl: "rgb(42, 148, 125)",
          // 警告颜色
          // 警告颜色
          warningColor: "#f2c97d",
          // 警告颜色悬停
          warningColorHover: "#f5d599",
          // 警告颜色按下
          warningColorPressed: "#e6c260",
          // 警告颜色补充
          warningColorSuppl: "rgb(240, 138, 0)",
          // 错误颜色
          errorColor: "#e88080",
          // 错误颜色悬停
          errorColorHover: "#e98b8b",
          // 错误颜色按下
          errorColorPressed: "#e57272",
          // 错误颜色补充
          errorColorSuppl: "rgb(208, 58, 82)",
          // 文本颜色
          // 基础文字颜色
          textColorBase: "#fff",
          // 文字颜色1
          textColor1: "rgba(255, 255, 255, 0.9)",
          // 文字颜色2
          textColor2: "rgba(255, 255, 255, 0.82)",
          // 文字颜色3
          textColor3: "rgba(255, 255, 255, 0.52)",
          // 禁用状态文字颜色
          textColorDisabled: "rgba(255, 255, 255, 0.38)",
          // 设置输入框的占位符颜色
          placeholderColor: "rgba(255, 255, 255, 0.38)",
          // 设置输入框禁用时的占位符颜色
          placeholderColorDisabled: "rgba(255, 255, 255, 0.28)",
          // 图标颜色
          iconColor: "rgba(255, 255, 255, 0.38)",
          // 禁用状态下的图标颜色
          iconColorDisabled: "rgba(255, 255, 255, 0.28)",
          // 悬停状态下的图标颜色
          iconColorHover: "rgba(255, 255, 255, 0.475)",
          // 按下状态下的图标颜色
          iconColorPressed: "rgba(255, 255, 255, 0.30400000000000005)",
          // 不透明度
          opacity1: "0.9",
          opacity2: "0.82",
          opacity3: "0.52",
          opacity4: "0.38",
          opacity5: "0.28",
          // 分割线颜色
          dividerColor: "rgba(255, 255, 255, 0.09)",
          // 边框颜色
          borderColor: "rgba(255, 255, 255, 0.24)",
          // 关闭按钮在鼠标悬停时的颜色
          closeIconColorHover: "rgba(255, 255, 255, 0.52)",
          // 关闭按钮的颜色
          closeIconColor: "rgba(255, 255, 255, 0.52)",
          // 关闭按钮在按下时的颜色
          closeIconColorPressed: "rgba(255, 255, 255, 0.52)",
          // 关闭按钮在鼠标悬停时的颜色
          closeColorHover: "rgba(255, 255, 255, .12)",
          // 关闭按钮在鼠标按下时的颜色
          closeColorPressed: "rgba(255, 255, 255, .08)",
          // 设置清除按钮的默认颜色
          clearColor: "rgba(255, 255, 255, 0.38)",
          // 设置清除按钮在鼠标悬停时的颜色
          clearColorHover: "rgba(255, 255, 255, 0.48)",
          // 设置清除按钮在鼠标按下时的颜色
          clearColorPressed: "rgba(255, 255, 255, 0.3)",
          // 滚动条颜色
          // 滚动条颜色
          scrollbarColor: "rgba(255, 255, 255, 0.2)",
          // 滚动条悬停颜色
          scrollbarColorHover: "rgba(255, 255, 255, 0.3)",
          // 滚动条宽度
          scrollbarWidth: "5px",
          // 滚动条高度
          scrollbarHeight: "5px",
          // 滚动条圆角
          scrollbarBorderRadius: "5px",
          // 进度条轨道颜色
          progressRailColor: "rgba(255, 255, 255, 0.12)",
          // 轨道颜色
          railColor: "rgba(255, 255, 255, 0.2)",
          // 弹出框颜色
          popoverColor: "rgb(72, 72, 78)",
          // 表格颜色
          tableColor: "rgb(24, 24, 28)",
          // 卡片颜色
          cardColor: "rgb(24, 24, 28)",
          // 模态框颜色
          modalColor: "rgb(44, 44, 50)",
          // 主体颜色
          bodyColor: "rgb(16, 16, 20)",
          // 标签颜色
          tagColor: "rgba(51, 51, 51, 1)",
          // 头像颜色
          avatarColor: "rgba(255, 255, 255, 0.18)",
          // 反转颜色
          invertedColor: "#000",
          // 输入框颜色
          inputColor: "rgba(255, 255, 255, 0.1)",
          // 代码颜色
          codeColor: "rgba(255, 255, 255, 0.12)",
          // 标签页颜色
          tabColor: "rgba(255, 255, 255, 0.04)",
          // 动作颜色
          actionColor: "rgba(255, 255, 255, 0.06)",
          // 表格头部颜色
          tableHeaderColor: "rgba(255, 255, 255, 0.06)",
          // 悬停颜色
          hoverColor: "rgba(255, 255, 255, 0.09)",
          // 表格悬停颜色
          tableColorHover: "rgba(255, 255, 255, 0.06)",
          // 表格条纹颜色
          tableColorStriped: "rgba(255, 255, 255, 0.05)",
          // 按下颜色
          pressedColor: "rgba(255, 255, 255, 0.05)",
          // 禁用不透明度
          opacityDisabled: "0.38",
          // 禁用输入框颜色
          inputColorDisabled: "rgba(255, 255, 255, 0.06)",
          // 按钮颜色2
          buttonColor2: "rgba(255, 255, 255, .08)",
          // 按钮颜色2悬停
          buttonColor2Hover: "rgba(255, 255, 255, .12)",
          // 按钮颜色2按下
          buttonColor2Pressed: "rgba(255, 255, 255, .08)",
          // 阴影
          boxShadow1:
            "0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",
          boxShadow2:
            "0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",
          boxShadow3:
            "0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)",
        },
      },
      mode: "light",
    };
  },
  persist: process.client && {
    // 仅在客户端使用
    storage: localStorage, // localStorage 本地存储，可替换sessionStorage
  },
});

export default styleStore;
